function ChessBoardTracker() {

	const CHESS_SCORE_LINK5              =  0x10000000;
	const CHESS_SCORE_ALIVE4             =  0x01000000;
	
	const CHESS_SCORE_SLEEP4             =  0x00100000;
	const CHESS_SCORE_ALIVE3             =  0x00100000;
	
	const CHESS_SCORE_SLEEP3             =  0x00010000;
	const CHESS_SCORE_ALIVE2             =  0x00001000;
	
	const CHESS_SCORE_SLEEP2             =  0x00000100;
	const CHESS_SCORE_ALIVE1             =  0x00000010;
	
	const CHESS_SCORE_SLEEP1             =  0x00000001;
	
	const CHESS_SCORE_DEAD               =  0x00000000;



	var statechangefunc = null;

	/*Create a table,and initialize it*/	
	var table = new Array(ChessInfo.chessboardrows);

	this.mytable = new Array(ChessInfo.chessboardrows);
	this.optable = new Array(ChessInfo.chessboardrows);
	
	for (i = 0; i < ChessInfo.chessboardrows; i++) {
		this.mytable[i] = new Array(ChessInfo.chessboardcolumns);
		this.optable[i] = new Array(ChessInfo.chessboardcolumns);
		for (j = 0; j < ChessInfo.chessboardcolumns; j++) {
			this.mytable[i][j] = 0;
			this.optable[i][j] = 0;
		}
	}

	this.init = function() {
		for (var i = 0; i < ChessInfo.chessboardrows; i++) {
			table[i] = new Array(ChessInfo.chessboardcolumns);
		}		
		this.clean();
	};
	
	this.clean = function() {
		for (var i = 0; i < ChessInfo.chessboardrows; i++) {
			for (var j = 0; j < ChessInfo.chessboardcolumns; j++) {
				table[i][j] = CHESS_EMPTY;
			}
		}
	};
	
	this.setChess = function(x, y, chess) {
		table[y][x] = chess;
	};
	
	this.getChess = function(x, y) {
		return table[y][x];
	};
}